serial: Implement serial_initfunc() macro
authorMarek Vasut <[email protected]>
Wed, 12 Sep 2012 15:49:58 +0000 (17:49 +0200)
committerTom Rini <[email protected]>
Mon, 15 Oct 2012 18:53:49 +0000 (11:53 -0700)
commit2a333aeb8ff4e7b05c47bfaec1816fc2eb8e0198
tree2da089ff67c1cf23ebacc9543c158c375ae4a9dd
parentbfb3127938edf672277ec745e1e2d7d5cad9dbff
serial: Implement serial_initfunc() macro

This macro simplifies declaration of weak aliases for per-driver
functions, which register these drivers with the serial subsystem.
The idea here is to push serial_register() calls from serial.c into
the drivers. To avoid pile of ifdef construct as it is now, create
weak aliases to these functions, which in case the driver is not
present alias onto an empty function, which is in turn optimized out
altogether.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Mike Frysinger <[email protected]>
common/serial.c